#pragma once
#include "qstring.h"
#include "qlist.h"
#include "dataentry.h"
#include <iostream>
#include <fstream>
#include <string>

class FileParser
{
public:
	QString a;
	FileParser();
	~FileParser(void);

	void					setPattern(QList<QString>);

	template<typename TYPE>
	bool read(QString filename, TYPE &list);

	QList<DataEntry*>*		getData(void) {return data;};
private:
	bool					parseFromString(QList<AirportEntry*>&, QString);
	bool					parseFromString(QList<RouteEntry*>&, QString);

	DataEntry::EntryType	entryType;
	QList<DataEntry*>*		data;
};

